import axios from "@/libs/api.request";
class RankingRules {
  queryList(params) {
    return axios.request({
      url: '/rankrule/queryList',
      method: 'post',
      data: params
    })
  }
  queryById(params) {
    return axios.request({
      url: '/rankrule/getone',
      method: 'post',
      data: params
    })
  }
  edit(params) {
    if(params.ruleId){
      return axios.request({
        url: '/rankrule/edit',
        method: 'post',
        data: params
      })
    }
    return axios.request({
      url: '/rankrule/add',
      method: 'post',
      data: params
    })
  }
  updateStatus(params){
    if(params.status === "0"){
      return axios.request({
        url: '/rankrule/start',
        method: 'post',
        data: params.id
      })
    }
    return axios.request({
      url: '/rankrule/stop',
      method: 'post',
      data: params.id
    })
  }
  del(params) {
    return axios.request({
      url: '/rankrule/del',
      method: 'delete',
      data: params
    })
  }
}
export default RankingRules
